POV-Ray : Newsgroups : povray.general : Lighting problem at extreme distances : Lighting problem at extreme distances Server Time
30 Jul 2024 22:22:15 EDT (-0400)
  Lighting problem at extreme distances  
From: Jörg 'Yadgar' Bleimann
Date: 24 Mar 2008 13:25:00
Message: <47e7f1fc$1@news.povray.org>
High!

Once more with my long-cherished Solar System project... originally I 
equalled 1 POV unit = 1 km - which pretty soon turned out to be 
unfeasible, as the Sun is several times farther even from Mercury than 
PoV-Ray's epsilon value would allow it to be rendered correctly, let 
alone the other celestial bodies in the Solar System.

So I introduced a scale value, based on the aphelion (furthest point of 
orbit from the Sun) of trans-Kuiper Belt object Sedna, and adjusted it 
dynamically to the distance between camera and the Sun (or any other body):

#declare AU=149597870.691; // 1 Astronomical Unit in kilometres

#declare scconst=14596; // scaling constant, found by manual approximation

#declare objdist=975.56*AU; // Sedna's aphelion
#declare camdist=10000;     // Camera distance from Sedna

#declare sc=scconst*(objdist/(975.56*AU)); // scale factor adjusted to 
camera-sun (or camera-other body) distance

light_source // Sun
{
   0/sc
   color rgb 1
   looks_like
   {
     sphere
     {
       0/sc, 695000/sc
       texture
       {
        pigment { color rgb 1 }
        finish { ambient 1 diffuse 0 }
       }
     }
   }
}

sphere // Sedna dummy for lighting test
{
   <0, 0, -objdist>/sc, 1800/sc
   texture
   {
     pigment
     {
       color rgb <0.5, 0.35, 0.2>
     }
     finish { ambient 0 diffuse 1 brilliance 0.4 }
   }
}
camera
{
   location <-camdist, 0, -objdist>/sc
   look_at <0, 0, -objdist>/sc
   angle 40
}

Works fine... as long as I adjust the scale value according to Sedna's 
distance to the Sun rather than to the camera-Sedna distance. If I try 
the latter (i. e. insert 10000 instead of 975.56*AU, which is about 14 
billions), the illuminated half of the Sedna dummy sphere appears 
terribly grainy!

Just keeping 975.56*AU (objdist) as scaling parameter, Sedna (about 1800 
kms in diameter) would be a mere 0.12 units large, making structures 
several orders of magnitude smaller (such as colonies, spaceships, local 
terrain features) impossible to model.

Is there a way to avoid this without changing the position of the light 
source? I understand that I'll have to fake the visible disk of the sun 
(probably by using a sky_sphere with a multi-layered object pattern 
pigment), but to have a realistic illumination geometry, it would be 
nice to have the actual origin of the light cosistent with the chosen 
scale...

See you on www.khyberspace.de!

Yadgar


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.